<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>车辆详情 - ${vehicle.brand} ${vehicle.model}</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/purchase.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/salesman/vehicleview.css">
</head>
<body>
<!-- 顶部导航 -->
<header class="dashboard-header">
  <div class="container">
    <div class="d-flex justify-content-between align-items-center">
      <div>
        <h1 class="h3 mb-0"><i class="bi bi-bicycle"></i> 电动车销售管理系统</h1>
        <p class="mb-0 opacity-75">业务员工作台</p>
      </div>
      <div class="d-flex align-items-center">
        <div class="me-3">
          <span class="d-none d-md-inline">${currentUser.name}</span>
          <div class="badge bg-light text-dark">
            <i class="bi bi-person-circle me-1"></i> 业务员
          </div>
        </div>
        <div class="dropdown">
          <button class="btn btn-light rounded-circle p-1" type="button" data-bs-toggle="dropdown">
            <i class="bi bi-gear fs-5"></i>
          </button>
          <ul class="dropdown-menu dropdown-menu-end">
            <li><a class="dropdown-item" href="${pageContext.request.contextPath}/changePassword"><i class="bi bi-lock me-2"></i> 修改密码</a></li>
            <li><hr class="dropdown-divider"></li>
            <li><a class="dropdown-item text-danger" href="logout"><i class="bi bi-box-arrow-right me-2"></i> 退出登录</a></li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</header>

<div class="container py-4">
  <!-- 面包屑导航 -->
  <nav aria-label="breadcrumb" class="mb-4">
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="${pageContext.request.contextPath}/vehicle/list">车辆信息管理</a></li>
      <li class="breadcrumb-item active" aria-current="page">车辆详情</li>
    </ol>
  </nav>

  <div class="d-flex justify-content-between align-items-center mb-4">
    <div>
      <h2 class="mb-0">${vehicle.brand} ${vehicle.model}</h2>
      <p class="text-muted mb-0">车辆详细信息</p>
    </div>
    <div>
      <a href="${pageContext.request.contextPath}/vehicle/edit?id=${vehicle.id}" class="btn btn-warning me-2">
        <i class="bi bi-pencil me-1"></i> 编辑
      </a>
      <a href="${pageContext.request.contextPath}/vehicle/list" class="btn btn-light">
        <i class="bi bi-arrow-left me-1"></i> 返回列表
      </a>
    </div>
  </div>

  <div class="vehicle-detail">
    <div class="row">
      <div class="col-md-6 mb-4 mb-md-0">
        <img src="${pageContext.request.contextPath}/images/vehicles/${vehicle.pic}"
             class="vehicle-img" alt="${vehicle.brand} ${vehicle.model}">
      </div>
      <div class="col-md-6">
        <div class="detail-item">
          <div class="small text-muted">品牌</div>
          <div class="h5">${vehicle.brand}</div>
        </div>
        <div class="detail-item">
          <div class="small text-muted">型号</div>
          <div class="h5">${vehicle.model}</div>
        </div>
        <div class="detail-item">
          <div class="small text-muted">颜色</div>
          <div class="h5">
            <span class="badge bg-primary">${vehicle.color}</span>
          </div>
        </div>
        <div class="detail-item">
          <div class="small text-muted">生产年份</div>
          <div class="h5">${vehicle.productionYear}年</div>
        </div>
        <div class="detail-item">
          <div class="small text-muted">价格</div>
          <div class="h3 text-primary">¥${vehicle.price}</div>
        </div>
        <div class="detail-item">
          <div class="small text-muted">图片名称</div>
          <div class="h6">${vehicle.pic}</div>
        </div>
      </div>
    </div>
  </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>